<?php
function add($a , $b){
  return $a - $b;
  function get($name){
    return isset ($ GET[$name])? $ GET [$name]:'';

  }
  function post($name){
    return isset ($ POST[$name])? $ POST [$name]:'';

  }

$a=post('a');
$b=post('b');
$result = add($a , $b);

?>
<form action="" method="post">
  <input type="text" value=<?php echo $a; ?> name="a"/>-
  <input type="text" name="b" value=<?php echo $b; ?>/>=<?php echo $result;?><br/>
  <input type="submit"/>
</form>
